import {Directive, ElementRef, Input} from '@angular/core';

@Directive({
  selector: '[colorLessThanZero]'
})
export class SColorDirective {
  @Input() colorLessThanZero = 'red'
  constructor(private el: ElementRef) {
    setTimeout(() => {
      if (this.el.nativeElement.innerText.startsWith('-')) {
        el.nativeElement.style.color = this.colorLessThanZero
      }
    },0)
  }

}
